package models;

import models.crudsiena.SienaSupport;
import siena.*;

/**
 * Created by IntelliJ IDEA.
 * User: Cyril
 * Date: 13.08.11
 * Time: 21:54
 * To change this template use File | Settings | File Templates.
 */
@Table("menu_item")
public class MenuItem extends SienaSupport {

    @Id(Generator.AUTO_INCREMENT)
    public Long id;

    @Column("url")
    @Max(150)
    public String url;

    @Column("title")
    @Max(150)
    public String title;

    @Column("color")
    @Max(6)
    public String color;

    @Column("order")
    public Integer order;

    @Override
    public String toString() {
        return String.format("{%s}%s", url, title);
    }

    public static Query<MenuItem> all() {
        return Model.all(MenuItem.class);
    }
}
